package mapevents;

import gameengine.map.Map;
import gameengine.map.unit.Unit;

public final class MapDeSelection extends AbstractMapEvent {

    private final transient int xSelection;
    private final transient int ySelection;
    private final transient Unit passiveSelected;

    public MapDeSelection(final int xCoordinate, final int yCoordinate, final Unit unit) {
        super();
        xSelection = xCoordinate;
        ySelection = yCoordinate;
        passiveSelected = unit;
    }

    @Override
    public MAPEVENTTYPE getType() {
        return MAPEVENTTYPE.DESELECT;
    }

    @Override
    public int getXStart() {
        return xSelection;
    }

    @Override
    public int getYStart() {
        return ySelection;
    }

    @Override
    public int getXTarget() {
        return 0;
    }

    @Override
    public int getYTarget() {
        return 0;
    }

    @Override
    public Unit getUnit() {
        return passiveSelected;
    }

    @Override
    public Unit getAttacker() {
        return null;
    }

    @Override
    public AbstractMapEvent newMapEvent(final int xClick, final int yClick, final boolean leftClick, final Map map, final int party) {
        return getMapEvent(xClick, yClick, leftClick, map, party);
    }
}
